const express = require("express")
const bodyParser = require("body-parser")


const app = express()

// 解析 application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({extended:false}))
// 解析json格式
app.use(bodyParser.json())
app.use(express.static("./public"))
app.get("/a",(req,res)=>{
    console.log(req.query)
    res.send("a接口")
})


app.post("/a",(req,res)=>{
    console.log(req.body)
    res.send("a接口post方法")
})

app.listen(3000,()=>{console.log("start at port 3000")})